
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>物业管理软件</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
	<meta name="author" content="Muhammad Usman">
    <link rel="stylesheet" href="${base}/script/ztree/css/demo.css" type="text/css">
	<#include "*/pubcss.ftl">
</head>

<body>
	<#include "*/top.ftl">
	<!-- topbar ends -->
	<div class="container-fluid">
		<div class="row-fluid">
			<#include "*/left.ftl">
			<div id="content" class="span10">
			<!-- content starts -->
			<div>
				<ul class="breadcrumb">
					<li>
						<a href="#">仪表管理</a> <span class="divider">/</span>
					</li>
					<li>
						<a href="#">打印抄表单</a>
					</li>
				</ul>
			</div>
			<form class="form-horizontal" id="findForm" method="post"  action="javascript:query();">
			<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-user"></i>住户信息</h2>
					</div>
					<div class="box-content">
						<div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">表类型</label>
									<div class="controls form-horizontal">
									  <select id="metertype" name="metertype">
									     <option value='water' <#if (metertype)?if_exists!='an'>selected</#if>>水表</option>
										 <option value='an' <#if (metertype)?if_exists=='an'>selected</#if>>电表</option>
									  </select>
									</div>
								</div>
								</fieldset> 
							</div>
							<div class="span6">
							   <div class="control-group form-horizontal">
								<label class="control-label">打印类型</label>
								<div class="controls">
								  <select id="printtype" name="printtype">
									     <option value="person" <#if (printtype)?if_exists!='unit'>selected</#if>>按抄表人员打印</option>
										 <option value="unit" <#if (printtype)?if_exists=='unit'>selected</#if>>按单元打印</option>
								  </select>
								</div>
							  </div>
							</div>
                        </div>
						<div class="row-fluid">
							<div class="span6">
							   <fieldset>
								<div class="control-group form-horizontal">
								   <label class="control-label" for="focusedInput">抄表人员</label>
									<div class="controls form-horizontal">
									  <input id="citySel" name="personName" type="text" readonly value="${(personName)?if_exists}" class="input-large focused"/>
									  <input id="personid" name="personid" type="hidden" readonly value="${(personid)?if_exists}" class="input-large focused"/>
		                                &nbsp;<a id="menuBtn" href="#" onclick="showMenu(); return false;"><i class="icon icon-color icon-add"></i></a>
									</div>
								</div>
								</fieldset> 
							</div>
							<div class="span6">
							   <div class="control-group form-horizontal">
								<label class="control-label">抄表单元</label>
								<div class="controls">
								  <input id="unitSel" name="unitName" type="text" readonly value="${(unitName)?if_exists}" class="input-large focused"/>
								  <input id="unitid" name="unitid" type="hidden" readonly value="${unitid?if_exists}" class="input-large focused"/>
		                                &nbsp;<a id="unitBtn" href="#" onclick="showUnitMenu(); return false;"><i class="icon icon-color icon-add"></i></a>
									
								</div>
							  </div>
							</div>
                        </div>
						<div class="row-fluid">
							<div class="span12">
								<div class="control-group form-horizontal">
									<label class="control-label" for="focusedInput">排序方式</label>
									<div class="controls">
										<select id="sorttype" name="sorttype">
									     <option value="meter" <#if (sorttype)?if_exists!='room'>selected</#if>>表号</option>
										 <option value="room" <#if (sorttype)?if_exists=='room'>selected</#if>>房号</option>
								        </select>
									</div>
								</div>
							</div>
						</div>
						<div class="row-fluid">
							<div class="span12">
								<div class="control-group form-horizontal" align="center">
						           <button type="submit" class="btn btn-primary">查询</button>
								   <button type="button" class="btn btn-primary" onclick="javascript:printeach();">打印</button>
						        </div>
							</div>
						</div>
					 <div class="row-fluid" id="person">
					 <div class="span12">
						<ul id="myTab" class="nav nav-tabs">
						<#assign index=1>
						<#list (cbnames)?if_exists as cbname>
						<li <#if index==1>class="active"</#if>><a href="#TAB_${cbname.substring(0,cbname.indexOf(","))}" data-toggle="tab">${cbname.substring(cbname.indexOf(",")+1)}</a></li>
						<#assign index=index+1>
						</#list>
					    </ul>
					  <div id="myTabContent" class="tab-content">
					    <#assign index=1>
						<#list (cbnames)?if_exists as cbname>
						<div class="tab-pane in <#if index==1>active</#if>" id="TAB_${cbname.substring(0,cbname.indexOf(","))}">
						    <#assign meters=(map.get(cbname))?if_exists>
						    <div class="row-fluid">
							<div class="span12" align="center">
							       ${cbname.substring(cbname.indexOf(",")+1)}(2015-06-06)
							</div>
							</div>
							<table class="table table-bordered table-striped table-condensed" border="1"  style="border:solid 1px black;border-collapse:collapse" id="dynamictable">
							  <thead>
								  <tr>
									  <th>序号</th>
									  <th>业主</th>
									  <th>表号</th>
									  <th>上期读数</th>
									  <th>本期读数</th>
									  <th>房号</th>
									  <th>联系电话</th>
								  </tr>
							  </thead>   
							  <tbody>
							    <#list (meters)?if_exists as meter>
								<tr>
									<td>1</td>
									<td  class="center">${(meter.pname)?if_exists}</td>
									<td class="center">${(meter.snum)?if_exists}</td>
									<td class="center">${(meter.thereadings)?if_exists}</td>
									<td class="center"></td>
									<td class="center">${(meter.room)?if_exists}</td>
									<td class="center">${(meter.tel)?if_exists}</td>
								</tr>
								</#list>
							  </tbody>
						  </table>
						</div>
						<#assign index=index+1>
						</#list>
					  </div>
					  </div><!--tab mycontent-->
					  </div>
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
            </form>
			<!-- content ends -->
			</div><!--/#content.span10-->
		</div><!--/fluid-row-->

		
	</div><!--/.fluid-container-->
	<div id="menuContent" class="menuContent" style="display:none; position: absolute;">
		<ul id="readPersonTree" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
	</div>
	<div id="unitContent" class="menuContent" style="display:none; position: absolute;">
		<ul id="unitTree" class="ztree" style="margin-top:0; width:180px; height: 300px;"></ul>
	</div>
	<#include "*/infotemplate/alert.ftl">
    <#include "*/infotemplate/saveinfo.ftl">
	<#include "*/pubjs.ftl">
	<#include "*/importprint.ftl">
	<script src='${base}/script/dashboard/print_manager.js'/></script>
</body>
</html>
